<template>
	<view class="all-main">
		<view class="main">
			<view class="content">
				<text v-html="content"></text>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				type: '',
				title: '',
				content: '',
			}
		},
		onLoad(e) {
			this.type = e.type
			if (e.type == 1) {
				this.title = "《特约商户银行卡业务受理协议》"
			} else if (e.type == 2) {
				this.title = "《豸信CA数字证书服务协议》"
			} else if (e.type == 3) {
				this.title = "《法大大电子签服务协议》"
			}
			uni.setNavigationBarTitle({
				title: this.title
			})
			this.loadData()
		},
		methods: {
			// 加载数据
			async loadData() {
				uni.showLoading({
					title: '加载中'
				});
				const {
					data: res
				} = await this.$myHttp({
					url: 'v1/getAgreement',
					data: {
						type: this.type
					}
				});
				uni.hideLoading()
				if (res.code == 200) {
					this.content = res.data.content
				}
			},
		}
	}
</script>

<style lang="scss">
	page {
		background-color: #ffffff; /* 设置背景颜色 */
	}
	.all-main {
		.main {
			.content {
				padding: 30rpx;
			}
		}
	}
</style>
